package com.css.productornacos02;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

/**
 * @author 郭辉
 * @className TODO
 * @description TODO
 * @date 2022/8/15 15:46
 * @company 海康威视
 * @since 1.0.0
 */
@RestController
@RequestMapping("/api/productor-nacos")
public class Controller {

    @Value("${token}")
    String token;

    @RequestMapping("/hello")
    public String hello() {
        System.out.println(((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest().getHeaders("gateway"));
//        System.out.println(token);
        return "Productor - nacos - 02";
    }
}
